//<template>
  <div>
      <p>账号：<input type="text" v-model="name"></p>
      <p>密码<input type="text" v-model="password"></p>
      <input type="button" value="登录" @click="login()">
  </div>
</template>

<script>
import axios from 'axios'
export default {
    data(){
        return{
            name:'',
            password:'',
        }
    },
    methods:{
        login(){
            let form_data = new FormData()
            form_data.append('name',this.name)
            form_data.append('password',this.password)
            axios({
                url:'http://127.0.0.1:8000/app03/login/',
                method:'post',
                data:form_data
            }).then(res=>{
                console.log(res.data)
                this.$router.push({path:'/newshow/'})
            })
        },
    }
}
</script>

<style>

</style>